package com.question.view.command.play;

import java.util.List;

import com.question.Design.SingletonMode;
import com.question.entity.Question;
import com.question.entity.User;
import com.question.service.IPlayerService;
import com.question.utils.MyUtils;
import com.question.view.Configure;

public class MyQuestionCommand extends PlayerSuper{
	private IPlayerService playerService = SingletonMode.getPlayerService();
	@Override
	protected void exec(User player) {
		List<Question> questionList =playerService.findQuestionByUser(player);
		System.out.printf("%-4s%-30s%s    %10s%20s   \n","id","问题标题","当前状态","创建时间",Configure.INTEGRAL);
		for (Question reQuestion : questionList) {
			System.out.printf("%-4s%-20s%-10s%20s   %3s \n",reQuestion.getId(),reQuestion.getQuestion_title(),(reQuestion.getQuestion_state_id()==1?"未解决":"解决"),
							MyUtils.date(reQuestion.getCreate_datetime()),reQuestion.getCredit());
		}
	}

}
